import { post, put, get } from '@/utils/hettpUtils/httpRequest'

export const tableColumns = [
    {
        title: '#',
        width: 50,
        scopedSlots: { customRender: 'serial' },
    },
    {
        width: 160,
        title: "表名",
        dataIndex: "name",
    },
    {
        ellipsis: true,
        title: "描述",
        dataIndex: "comment",
    },
    // {
    //     title: "是否新增",
    //     align: 'center',
    //     dataIndex: "isAdd",
    //     scopedSlots: { customRender: 'isAdd' },
    // },
    // {
    //     title: "是否修改",
    //     align: 'center',
    //     dataIndex: "isEdit",
    //     scopedSlots: { customRender: 'isEdit' },
    // },
    // {
    //     title: "是否详情",
    //     align: 'center',
    //     dataIndex: "isDetail",
    //     scopedSlots: { customRender: 'isDetail' },
    // },
    {
        title: "是否分页",
        align: 'center',
        dataIndex: "isPage",
        scopedSlots: { customRender: 'isPage' },
    },
    {
        title: "是否弹出层",
        align: 'center',
        dataIndex: "isOpenModal",
        scopedSlots: { customRender: 'isOpenModal' },
    },
    {
        width: 200,
        title: "是否左侧树",
        dataIndex: "isLeftTree",
        scopedSlots: { customRender: 'isLeftTree' },
    },
];

export const columns = [
    {
        title: '#',
        width: 50,
        scopedSlots: { customRender: 'serial' },
    },
    {
        width: 160,
        ellipsis: true,
        title: "字段名",
        dataIndex: "name",
    },
    {
        width: 130,
        ellipsis: true,
        title: "字段描述",
        dataIndex: "coment",
    },
    {
        width: 120,
        ellipsis: true,
        title: "类型",
        dataIndex: "dbTypeTextFull",
    },
    {
        width: 70,
        align: 'center',
        title: "主键",
        dataIndex: "isPrimary",
        scopedSlots: { customRender: "isPrimary" },
    },
    {
        width: 70,
        align: 'center',
        title: "为空",
        dataIndex: "isNullable",
        scopedSlots: { customRender: "isNullable" },
    },
    {
        width: 70,
        title: "查询",
        align: 'center',
        dataIndex: "isWhere",
        scopedSlots: { customRender: "isWhere" },
    },
    
    {
        width: 70,
        title: "必填",
        align: 'center',
        dataIndex: "isRequired",
        scopedSlots: { customRender: "isRequired" },
    },
    {
        width: 70,
        title: "列表",
        align: 'center',
        dataIndex: "isList",
        scopedSlots: { customRender: "isList" },
    },
    {
        width: 70,
        title: "新增",
        align: 'center',
        dataIndex: "isAdd",
        scopedSlots: { customRender: "isAdd" },
    },
    {
        width: 70,
        title: "编辑",
        align: 'center',
        dataIndex: "isModify",
        scopedSlots: { customRender: "isModify" },
    },
    {
        width: 70,
        title: "详情",
        align: 'center',
        dataIndex: "isDetail",
        scopedSlots: { customRender: "isDetail" },
    },
    {
        width: 200,
        title: "字典外键",
        dataIndex: "isDicForeignKey",
        scopedSlots: { customRender: "isDicForeignKey" },
    },
    {
        width: 200,
        title: "表外键",
        dataIndex: "isForeignKey",
        scopedSlots: { customRender: "isForeignKey" },
    },
    {
        width: 160,
        title: "排序",
        dataIndex: "isSort",
        scopedSlots: { customRender: "isSort" },
    },
   
    // {
    //     width: 100,
    //     align: 'center',
    //     title: "自增",
    //     dataIndex: "isIdentity",
    //     scopedSlots: { customRender: "isIdentity" },
    // },
    // {
    //     title: "默认值",
    //     dataIndex: "defaultValue",
    // }, 
];


export const getModelList = (parameter) => get('api/sysCodeBuilder/getModelList', parameter)
export const getDbList = (parameter) => get('api/sysCodeBuilder/getDbList', parameter)
export const getTableList = (parameter) => get('api/sysCodeBuilder/getTableList', parameter)
export const builderProject = (parameter) => post('api/sysCodeBuilder/builderProject', parameter)
export const create = (parameter) => post('api/sysCodeBuilder/create', parameter)
